﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TSqlServer;
/// <summary>
/// TAdMagazine 的摘要说明
/// </summary>
public class TAdMagazine:TData
{

    //常量
  	const string CTableName="t_ad_magazine";
    const string CKeyName = "magcode";
    //与数据表字段对应的变量
    private string FMagCode ; 
    private string FMagName ; 
    private string FMagName2 ; 
    private string FMagType ; 
    private string FCreateTime ; 
    private string FNotice ; 
    private string FInputer ; 
    private DateTime FInput_Time ; 
	public TAdMagazine()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//

        FTableName = CTableName;
        FKeyName = CKeyName;
	}

    public TAdMagazine(string sid)
    {
    	FTableName = CTableName;
        FKeyName = CKeyName;
        FKeyValue = sid;
    }
    public override void Select()
    {
        string strSql = GetSelectString();
        TSqlDB oDB = new TSqlDB(strSql);
        if (!oDB.EOF)
        {

            FMagCode = oDB["MagCode"].ToString();
            FMagName = oDB["MagName"].ToString();
            FMagName2 = oDB["MagName2"].ToString();
            FMagType = oDB["MagType"].ToString();
            FCreateTime = oDB["CreateTime"].ToString();
            FNotice = oDB["Notice"].ToString();
            FInputer = oDB["Inputer"].ToString();
            FInput_Time = oDB["Input_Time"].ToDateTime();
        }
        oDB.Free();
    }
    //插入新记录。
    public void Insert()
    {
        string ExSql = "'" + FMagCode + "','" + FMagName + "','" + FMagName2 + "','" + FMagType + "','" + FCreateTime + "','" + FNotice + "','" + FInputer + "','" + FInput_Time + "'";
        base.Insert(ExSql);
    }
    //更新记录。
    public void Update()
    {
        string ExSql=" MagName ='" + FMagName + "', MagName2 ='" + FMagName2 + "', MagType ='" + FMagType + "', CreateTime ='" + FCreateTime + "', Notice ='" + FNotice + "', Inputer ='" + FInputer + "', Input_Time ='" + FInput_Time + "'"; 
        base.Update(ExSql);
    }
    //改变状态,0=未验证,1=已通过验证
    //public void Update_status()
    //{
    //    string ExSql = "status=" + FStatus.ToString(); ;
    //    base.Update(ExSql);
    //}
    //静态，可以不用创建对象即可调用。
    public static void DeleteByID(string sID)
    {
        TData.DeleteByID(sID, CTableName, CKeyName);
    }


    public string MagCode
    {
        get
        {
            return FMagCode;
        }
        set
        {
            FMagCode = value;
        }
    }
    public string MagName
    {
        get
        {
            return FMagName;
        }
        set
        {
            FMagName = value;
        }
    }
    public string MagName2
    {
        get
        {
            return FMagName2;
        }
        set
        {
            FMagName2 = value;
        }
    }
    public string MagType
    {
        get
        {
            return FMagType;
        }
        set
        {
            FMagType = value;
        }
    }
    public string CreateTime
    {
        get
        {
            return FCreateTime;
        }
        set
        {
            FCreateTime = value;
        }
    }
    public string Notice
    {
        get
        {
            return FNotice;
        }
        set
        {
            FNotice = value;
        }
    }
    public string Inputer
    {
        get
        {
            return FInputer;
        }
        set
        {
            FInputer = value;
        }
    }
    public DateTime Input_Time
    {
        get
        {
            return FInput_Time;
        }
        set
        {
            FInput_Time = value;
        }
    }
}
